This repository has been archived by the owner on Jan 24, 2025. It is now read-only.
feat(docz-theme-default): add options to the props component #823
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposition
With the version 1.0 of Docz, the display of props with the
<Props>
component is a little rough.(https://spectrum.chat/docz/general/please-bring-back-the-props-table-ui~7ebcbebf-137f-43fe-91f1-e4de8e8e0e2a)
The idea is to provide a more clean way to display props out of the box.
I introduce 3 new props for the
<Props>
component:I also introduce 2 colors in the default theme:
propsText
&propsBg
.It's my first time with CSS in JS and styled-components so feel free to challenge the code ;)
So the result looks like that:
<Props of={Button} />
<Props of={Button} isRaw />
<Props of={Button} isToggle title="⚛️ Button props" />
Dark mode render

Responsive render

Todo
Pre-merge checklist
Feel free to say if it's not a good idea or if this can be done with a better way ;)