
src/app.settings.ts and displayed with form components from experimental_useWorkspaceSettingsForm().
Unlike regular forms in dialogs, workspace settings forms automatically save changes and don’t require
a submit button or onSubmit handler. Each field saves individually:
- Text inputs and number inputs save
onBlur(when the user leaves the field) - Toggles, checkboxes, and comboboxes save
onChange(immediately when changed)
Only workspace admins can edit workspace settings. However, all workspace members can view the settings.
The Workspace Settings API is experimental and may change in the future. Please don’t use it in production versions of your app.
Example: Basic Workspace Settings
First, define your settings schema. This must be in a file calledapp.settings.ts at src/app.settings.ts:
app.settings.ts
workspace-settings.tsx
app.ts:
app.ts
- Define a workspace settings schema at
src/app.settings.ts - Create a workspace settings object with a
Page - Use
experimental_useWorkspaceSettingsForm()to get form components - Wrap your settings inputs in the
<Form/>and organize with<Section/>components - Register the settings in your
app.ts
Validation
Unlike regular forms where validation is defined in the schema, workspace settings validation is specified directly on the input components:workspace-settings-validation.tsx
Available Components
Workspace settings forms support the following components:Input Components
<TextInput />- String input with validation<NumberInput />- Numeric input with min/max<Toggle />- Boolean toggle switch<Checkbox />- Boolean checkbox<Combobox />- Dropdown selection<Experimental_AttioUserCombobox />- Select workspace users
Layout Components
<Section />- Group settings into sections<InputGroup />- Group inputs horizontally
Utility Components
<Button />- Action buttons for additional functionality<WithState />- Access form state for conditional rendering
Accessing Settings in Your App
Once your workspace settings are configured, you can access them in different ways:With Real-time Updates
In React components, use theexperimental_useWorkspaceSettings() hook to get settings that automatically update when changed:
widget.tsx
Programmatically
Use these functions to get and set settings. They’re available from bothattio/client (for use in React components, actions, etc.) and attio/server (for use in server functions):
In client code:
record-action.tsx
sync-data.server.ts
experimental_getWorkspaceSettings(), experimental_getWorkspaceSetting(), and experimental_setWorkspaceSetting() for more details.
Related Documentation
- Workspace Settings Entry Point
experimental_useWorkspaceSettings()- Hook for accessing settings in React componentsexperimental_getWorkspaceSettings()- Get all settings in server actionsexperimental_getWorkspaceSetting()- Get a single setting in server actionsexperimental_setWorkspaceSetting()- Set a single setting in server actionsexperimental_useWorkspaceSettingsForm()- Hook for creating the settings form- Workspace Settings Schema
- Settings Components
