# NavigationTitleSelect
A select component styled as a navigation title, allowing users to switch between different views or contexts from the header. It uses a Dropdown to display options.
## Import
```tsx
import { NavigationTitleSelect } from '@coinbase/cds-web/navigation/NavigationTitleSelect'
```
## Examples
NavigationTitleSelect wraps a [Dropdown](/components/layout/Dropdown) to create a context-switching control styled as a navigation title. Use it to let users switch between accounts, portfolios, or other contexts in a header.
### Basics
Provide an array of `options` with `label` and `id` fields, a `value` matching the selected option's `id`, and an `onChange` handler.
```jsx live
function BasicExample() {
const options = [
{ label: 'My Portfolio', id: 'portfolio' },
{ label: 'Family Account', id: 'family' },
{ label: 'Business Account', id: 'business' },
];
const [value, setValue] = useState('portfolio');
return (
);
}
```
### Custom Labels
Option labels can be React nodes for richer content, such as displaying an icon alongside text.
```jsx live
function CustomLabelExample() {
const options = [
{
label: (
Personal Wallet
),
id: 'personal',
},
{
label: (
Shared Vault
),
id: 'shared',
},
];
const [value, setValue] = useState('personal');
return (
);
}
```
### Styling
#### Color
Use `color` to customize the text and caret icon color. Any valid CDS design token color works.
```jsx live
function ColorExample() {
const options = [
{ label: 'Assets', id: 'assets' },
{ label: 'Activity', id: 'activity' },
];
const [value, setValue] = useState('assets');
return (
);
}
```
#### Font
Use `font` to adjust the typography. The default is `title1`.
```jsx live
function FontExample() {
const options = [
{ label: 'Dashboard', id: 'dashboard' },
{ label: 'Settings', id: 'settings' },
];
const [value, setValue] = useState('dashboard');
return (
);
}
```
### Accessibility
Always provide `accessibilityLabel` to describe the purpose of the select for screen readers. The component manages focus and keyboard navigation through the underlying [Dropdown](/components/layout/Dropdown).
```jsx live
function AccessibilityExample() {
const accounts = [
{ label: 'Checking ••4521', id: 'checking' },
{ label: 'Savings ••8832', id: 'savings' },
{ label: 'Investment ••2109', id: 'investment' },
];
const [account, setAccount] = useState('checking');
return (
);
}
```
## Props
| Prop | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `onChange` | `(value: string) => void` | Yes | `-` | - |
| `options` | `{ label: ReactNode; id: string; }[]` | Yes | `-` | - |
| `value` | `string` | Yes | `-` | - |