A simple input component with support for easy labels and placeholders.
---import { Input } from 'studiocms:ui/components';---
<Input label='Label' placeholder='Placeholder' />You can set the input’s type to like you would normally. Here’s a password input to show you how that’s done:
---import { Input } from 'studiocms:ui/components';---
<Input label='Label' placeholder='Placeholder' type='password' />You can disable the input altogether by using the disabled prop.
---import { Input } from 'studiocms:ui/components';---
<Input label='Label' placeholder='Placeholder' disabled />Inputs have full form support. You can use the isRequired and name attributes as needed.
The first one does what it says it does, while the latter sets the name attribute so you can access the input in, for example,
the FormData returned by a submission. Here’s an example showing how to set both of them:
---import { Input } from 'studiocms:ui/components';---
<Input label='Label' placeholder='Placeholder' isRequired name='example-input' />