Overview
Toggle elements provide simple on/off controls. They’re perfect for enabling/disabling features or choosing between two states.Switch Toggle
Boolean toggle for enabling/disabling features. Provides a visual on/off switch UI.Properties
Validation
Setting
required: true means the switch must be ON. This is useful for terms acceptance or required opt-ins. Most switches should not be required.Example
linkapp.config.ts
Usage in Layout
app/expanded.tsx
Common Patterns
Feature toggle:Multiple Switches
Group related switches under one title:Switch vs. Checkbox
When to use switch vs. single checkbox:Link Behavior
Linktree-specific control for how links behave when clicked. Users choose between showing your LinkApp UI (embed) or navigating directly to the URL (link off).Properties
Link Behavior Labels
Link Behavior lets users choose:
- Embed (
embedLabel): Display your LinkApp’s UI when clicked (renders your layout) - Link Off (
linkOffLabel): Navigate directly to the URL (bypass your layout)
embedLabel (show your LinkApp).Example
linkapp.config.ts
Usage in Layout
app/expanded.tsx
Common Use Cases
Video embed:When to Use
UselinkBehavior when:
✅ Your LinkApp embeds or displays content from the URL
✅ Users might want to bypass your UI and go straight to the source
✅ You’re building a media player, content previewer, or social embed
Don’t use when:
❌ Your LinkApp doesn’t use the linkUrl at all
❌ Going directly to the URL doesn’t make sense
❌ Your LinkApp is purely decorative
Validation
Typically,
linkBehavior should have validation: { required: true } so users explicitly choose their preference.
Complete Example
Here’s a video embed LinkApp using both toggle types:linkapp.config.ts
app/expanded.tsx
Best Practices
Use Clear Labels
Set Sensible Defaults
Group Related Switches
Use a singletitle for the group, empty strings for subsequent items:
Link Behavior Labels Should Be Specific
Type Safety
Define boolean types for switches:Next Steps
Text Inputs
Text, textarea, URL, and number inputs
Selection Controls
Select, radio, and checkbox elements
Advanced Elements
Arrays, integrations, and conditional display
Back to Reference
Return to settings reference overview