Skip to content

Commit

Permalink
Update Toggle documentation, fix ToggleGroup stories
Browse files Browse the repository at this point in the history
  • Loading branch information
cgero-eth committed Jan 11, 2024
1 parent b8315f5 commit c8e8500
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/components/toggles/toggle/toggle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ export interface IToggleProps extends Omit<ComponentProps<'button'>, 'ref'> {
label: string;
}

/**
* The Toggle component is a button that handles the "on" and "off" states.
*
* **NOTE**: The component must be used inside a `<ToggleGroup />` component in order to work properly.
*/
export const Toggle: React.FC<IToggleProps> = (props) => {
const { className, label, value, disabled, ...otherProps } = props;

Expand Down
4 changes: 2 additions & 2 deletions src/components/toggles/toggleGroup/toggleGroup.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { useState } from 'react';
import { Toggle } from '../toggle';
import { ToggleGroup, type IToggleGroupProps } from './toggleGroup';

const meta: Meta<typeof Toggle> = {
const meta: Meta<typeof ToggleGroup> = {
title: 'components/Toggles/ToggleGroup',
component: Toggle,
component: ToggleGroup,
tags: ['autodocs'],
parameters: {
design: {
Expand Down

0 comments on commit c8e8500

Please sign in to comment.