UNPKG

@carbon/react

Version:

React components for the Carbon Design System

32 lines (31 loc) 1.11 kB
/** * Copyright IBM Corp. 2016, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import React, { type ChangeEventHandler } from 'react'; export interface SideNavSwitcherProps { /** * Provide an optional class to be applied to the containing node */ className?: string; /** * Provide the label for the switcher. This will be the first visible option * when someone views this control */ labelText: string; /** * Provide a callback function that is called whenever the switcher value is * updated */ onChange?: ChangeEventHandler<HTMLSelectElement>; /** * Provide an array of options to be rendered in the switcher as an * `<option>`. The text value will be what is displayed to the user and is set * as the `value` prop for each `<option>`. */ options: string[]; } declare const SideNavSwitcher: React.ForwardRefExoticComponent<SideNavSwitcherProps & React.RefAttributes<HTMLSelectElement>>; export default SideNavSwitcher;