Skip to main content

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:
Display option:
Required acceptance:
Privacy setting:

Multiple Switches

Group related switches under one title:
Usage:

Switch vs. Checkbox

When to use switch vs. single checkbox:
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 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)
If not specified, defaults to embedLabel (show your LinkApp).

Example

linkapp.config.ts

Usage in Layout

app/expanded.tsx

Common Use Cases

Video embed:
Content preview:
Social media:

When to Use

Use linkBehavior 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
Layout implementation:
app/expanded.tsx

Best Practices

Use Clear Labels

Set Sensible Defaults

Use a single title for the group, empty strings for subsequent items:

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