Button
Interactive button component with multiple variants and sizes. Supports icons, loading states, and accessibility features.
Importβ
import { Button } from '@scaffald/ui';
Basic Usageβ
Propsβ
See the TypeScript definitions for the complete props API.
Common Propsβ
All Button components accept standard React Native View props.
Variantsβ
Visual Variantsβ
filled(default) - Solid background buttonoutline- Outlined button with transparent backgroundghost- Minimal button with no backgroundtext- Text-only button
Sizesβ
sm- Small buttonmd(default) - Medium buttonlg- Large button
Loading stateβ
Use the loading prop to show a loading indicator inside the button. The indicator is sized to fit the button (sm/md/lg). This matches the pattern used on onboarding and other forms.
Do not put a <Spinner> or other large indicator in the button's childrenβthat can overflow the button. Use the loading prop instead.
If you don't see loading indicator updates after changing the UI package, rebuild it (pnpm nx run @scaffald/ui:build) or restart the dev server so the app picks up the latest build.
<Button loading>Saving</Button>
<Button loading variant="filled" color="primary">Submit</Button>
Examplesβ
Accessibilityβ
- Keyboard navigation support
- Screen reader compatible
- ARIA attributes included
- Focus management
Design Tokensβ
This component uses the following design tokens:
- Colors:
colors.{semantic}.{theme}.{variant} - Spacing:
spacing.* - Typography:
typography.*
See Design Tokens for more information.
Related Componentsβ
Changelogβ
See GitHub Releases for version history.