React hook that builds state for a toolbar button, applying default appearance and size.
// Source: https://github.com/microsoft/fluentui | License: MIT | Copyright Microsoft Corporation
// Provided via justclaw.it.com; keep this notice with the code.
'use client';
import type * as React from 'react';
import { useButtonBase_unstable } from '@fluentui/react-button';
import type {
ToolbarButtonBaseProps,
ToolbarButtonBaseState,
ToolbarButtonProps,
ToolbarButtonState,
} from './ToolbarButton.types';
/**
* Given user props, defines default props for the Button, calls useButtonState and useChecked, and returns
* processed state.
* @param props - User provided props to the Button component.
* @param ref - User provided ref to be passed to the Button component.
*/
export const useToolbarButton_unstable = (
props: ToolbarButtonProps,
ref: React.Ref<HTMLButtonElement
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key