Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(sidebar): Document new renderBottomCmp prop #66

Merged
merged 1 commit into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/components/date-picker.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ With the prop <Tag text='format' />, and its <Tag text='short' /> and <Tag text=

##### <span name="floating-nav">OnlyOf</span>

With the prop <Tag text='onlyOf' />, its variants <Tag text='year' />, <Tag text='month' />, <Tag text='day' /> and <Tag text='month' />/span> you can control the format
With the prop <Tag text='onlyOf' />, its variants <Tag text='year' />, <Tag text='month' />, <Tag text='day' /> and <Tag text='month' /> you can control the format

<Playground>

Expand Down
17 changes: 17 additions & 0 deletions docs/layout/sidebar.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,22 @@ Example:
/>
' />

<br />
##### <span name="floating-nav">RenderBottomCmp</span>

A render prop that allows you to use a fully custom element at the bottom of the SideBar. When using it alongside the <Tag text='dangerZone' /> prop, the Danger Zone will be displayed below.

The expanded state of the SideBar is passed as an argument to the render prop, making it easy for you to adjust your component accordingly.

Example:

<WindowEditor codeString='import { Sidebar } from "dd360-ds"

<SideBar
&nbsp;&nbsp;sideBarName="Sidebar"
&nbsp;&nbsp;renderBottomCmp={(isExpanded) => <CustomComponent isExpanded={isExpanded} />}
/>' />

<br />
##### <span name="floating-nav">DisabledOptionsTag</span>

Expand Down Expand Up @@ -339,6 +355,7 @@ Left position of the sidebar.
},
{ title: 'disabledOptionsTag', default: null, types: ['string'] },
{ title: 'dangerZone', default: null, types: ['{ show: boolean, text: string, active: boolean, callBack?: (() => void), }'] },
{ title: 'renderBottomCmp', default: null, types: ['(isExpanded: boolean) => ReactElement'] },
{ title: 'flushSync', default: null, types: ['(<R>(fn: () => R) => R)'] },
{ title: 'defaultExpand', default: 'false', types: ['boolean'] },
{ title: 'top', default: null, types: ['number'] },
Expand Down
Loading