Skip to content

Label

A styled label component for displaying a label next to a form input. Other form inputs such as TextInput, Dropdown, Checkbox and Radio are already wrapped in a label component. Use this if you want to use the label for other purposes.

See all the examples and details in the Storybook.

Usage

tsx
import { Label } from "@samgl/graffiti-ui";

const MyLabel = () => {
  return (
    <Label>
      Username <input type="text" />
    </Label>
  );
};

Props

PropTypeDefaultOptionalDescription
$layoutstringcolumnShould the label and input be above and below each other (column) or alongside each other (row)?
childrenReactNodeThe content of the Label.
classNamestringThe class name of the component, generally used when extending the component with a styled component.