WIP Label
This commit is contained in:
parent
7617a8b9ee
commit
c68d0173df
@ -2,7 +2,7 @@ import React from 'react';
|
|||||||
import t from 'prop-types';
|
import t from 'prop-types';
|
||||||
|
|
||||||
const Label = ({ children, spacing, className, text, ...rest }) => {
|
const Label = ({ children, spacing, className, text, ...rest }) => {
|
||||||
const baseClasses = 'block text-gray-700 text-sm font-bold';
|
const baseClasses = 'flex flex-1 flex-col text-gray-700 text-sm font-bold';
|
||||||
|
|
||||||
const getClasses = () => {
|
const getClasses = () => {
|
||||||
const classes = [];
|
const classes = [];
|
||||||
@ -12,12 +12,10 @@ const Label = ({ children, spacing, className, text, ...rest }) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<label className={getClasses()}>
|
||||||
<label className={getClasses()}>
|
{text}
|
||||||
{text}
|
{children}
|
||||||
{children}
|
</label>
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -16,5 +16,7 @@ import Label from './';
|
|||||||
## Basic usage
|
## Basic usage
|
||||||
|
|
||||||
<Playground>
|
<Playground>
|
||||||
<Label text="Label" />
|
{() => {
|
||||||
|
return <Label text="Label" />;
|
||||||
|
}}
|
||||||
</Playground>
|
</Playground>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user