G
Tokens
TypographySpacingColorRadiusShadowMotion

Field

Variables

VariableValue
var(--grn-field-paddingX)var(--grn-space-s2)
var(--grn-field-border-color)var(--grn-color-fade3)
var(--grn-field-border-color-hover)var(--grn-color-fade6)
var(--grn-field-border-color-focus)var(--grn-color-shade9)
var(--grn-field-border-color-disabled)var(--grn-color-shade5)
var(--grn-field-background-disabled)var(--grn-color-shade2)
var(--grn-field-placeholder-color)var(--grn-color-shade7)

  () => {
    const [value, setValue] = useState('');
    const style = `
      .inputExample {
        appearance: none;
        font: inherit;
        color: inherit;
        width: 100%;
        padding-inline: var(--grn-field-paddingX);
        border: 1px solid var(--grn-field-border-color);
        height: var(--grn-textbox-height-m);
        border-radius: var(--grn-textbox-radius-m);
        transition: var(--grn-transition-leave);
      }
      .inputExample::placeholder {
        color: var(--grn-field-placeholder-color);
      }
      .inputExample:hover {
        border-color: var(--grn-field-border-color-hover);
        transition: var(--grn-transition-hover);
      }
      .inputExample:focus {
        border-color: var(--grn-field-border-color-focus);
        transition: var(--grn-transition-active);
        outline: none;
      }
    `;
    return (
      <>
        <style>{style}</style>
        <input
          type="text"
          value={value}
          onChange={(e) => setValue(e.target.value)}
          placeholder="Placeholder"
          className="inputExample"
        />
      </>
    )}
    

FieldLabel


    <FieldLabel>FieldLabel</FieldLabel>

FieldHint


    <FieldHint>FieldHint</FieldHint>

InputField


    <InputField />

FieldClearButton


    <FieldClearButton />

Props

FieldLabel

Name
Type
Default
children
node

FieldHint

Name
Type
Default
children
node

InputField

Name
Type
Default
paddingLeft
oneOfType
oneOf
"xs" "s" "s2" "m" "l" "l2" "xl" "xl2" "xxl"
number
string
'var(--grn-field-paddingX)'
paddingRight
oneOfType
oneOf
"xs" "s" "s2" "m" "l" "l2" "xl" "xl2" "xxl"
number
string
'var(--grn-field-paddingX)'
hasError
bool
isReadOnly
bool
isDisabled
bool
backgroundColor
oneOfType
Object.keys(vars.colors)
string

FieldClearButton

Name
Type
Default
tag
oneOf
'button' 'a' 'span'
'button'
onClick
func