Skip to content
View Markdown

Form ​

A scrollable group of fields and settings.

tsx
import { Form, Toggle, TextField } from '@satinhq/kit'

Example ​

Full example
tsx
import { useState } from 'react'
import { Form, Screen, Section, TextField, Toggle } from '@satinhq/kit'

function Example() {
  const [name, setName] = useState('Alex')
  const [notifications, setNotifications] = useState(true)

  return (
    <Screen>
      <Form id="settings">
        <Section header="Preferences">
          <TextField label="Name" value={name} onChange={setName} />
          <Toggle label="Notifications" isOn={notifications} onChange={setNotifications} />
        </Section>
      </Form>
    </Screen>
  )
}

Bind each field ​

Store editable values in React state. Pass the current value and its setter to each control.

Describe a group ​

Use a Section header for its name and a footer for explanatory text. Form uses grouped rows without extra CSS.

API ​

Scroll horizontally to read every column.

PropTypeDescription
idstringA stable scroll region name.
childrenReactNodeSections and controls.
searchableSearchableOptional search configuration.

Related: Quick start, List, Screen.

:::

Satin runs on the Lumen rendering engine and is open source under the MIT License.