Skip to content

Commit

Permalink
Readme fixes based on feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
brookewp committed Feb 24, 2023
1 parent 1e130e3 commit df23167
Showing 1 changed file with 17 additions and 18 deletions.
35 changes: 17 additions & 18 deletions packages/components/src/panel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,20 +77,20 @@ const MyPanel = () => (

##### Props

###### header:`string`
###### `header`: `string`

The text that will be rendered as the title of the panel. Text will be rendered inside an
`<h2>` tag.

- Required: No

###### className: `string`
###### `className`: `string`

The CSS class to apply to the wrapper element.

- Required: No

###### children: `React.ReactNode`
###### `children`: `React.ReactNode`

The content to display within the panel row.

Expand All @@ -104,61 +104,60 @@ The `PanelBody` creates a collapsible container that can be toggled open or clos

##### Props

###### title: `string`
###### `title`: `string`

Title text. It shows even when it is closed.

- Required: No

###### opened: `boolean`
###### `opened`: `boolean`

When set to `true`, the component will remain open regardless of the `initialOpen` prop and the
panel will be prevented from being closed.

- Required: No

###### className: `string`
###### `className`: `string`

The CSS class to apply to the wrapper element.

- Required: No

###### icon: `JSX.Element`
###### `icon`: `JSX.Element`

An icon to be shown next to the title.

- Required: No

###### onToggle: `( next: boolean ) => void;`
###### `onToggle`: `( next: boolean ) => void;`

A function that is called any time the component is toggled from its closed state to its
opened state, or vice versa.

- Required: No
- Default: `noop`

###### initialOpen: `boolean`
###### `initialOpen`: `boolean`

Whether or not the panel will start open.

- Required: No
- Default: `true`

###### children: `| React.ReactNode | ( ( props: { opened: boolean } ) => React.ReactNode )`
###### `children`: `| React.ReactNode | ( ( props: { opened: boolean } ) => React.ReactNode )`

The content to display in the `PanelBody`.If a function is provided for this prop, it will
receive an object with the `opened` prop as an argument.
The content to display in the `PanelBody`. If a function is provided for this prop, it will receive an object with the `opened` prop as an argument.

- Required: No

###### buttonProps: `WordPressComponentProps<Omit< ButtonAsButtonProps, 'icon' >, 'button', false>`
###### `buttonProps`: `WordPressComponentProps<Omit< ButtonAsButtonProps, 'icon' >, 'button', false>`

Props that are passed to the `Button` component in title within the `PanelBody`.

- Required: No
- Default: `{}`

###### scrollAfterOpen: `boolean`
###### `scrollAfterOpen`: `boolean`

Scrolls the content into view when visible. This improves the UX when multiple `PanelBody`
components are stacked in a scrollable container.
Expand All @@ -174,13 +173,13 @@ components are stacked in a scrollable container.

##### Props

###### className: `string`
###### `className`: `string`

The CSS class to apply to the wrapper element.

- Required: No

###### children: `React.ReactNode`
###### `children`: `React.ReactNode`

The content to display within the panel row.

Expand All @@ -200,13 +199,13 @@ PanelRow accepts a forwarded ref that will be added to the wrapper div. Usage:

##### Props

###### label: `string`
###### `label`: `string`

The text that will be rendered as the title of the `Panel`. Will be rendered in an `<h2>` tag.

- Required: No

###### children: `React.ReactNode`
###### `children`: `React.ReactNode`

The content to display within the panel row.

Expand Down

0 comments on commit df23167

Please sign in to comment.