docs(code-snippet): add "Custom show more/less text" example (#1918)

This commit is contained in:
metonym 2024-02-24 10:39:14 -08:00 committed by GitHub
commit 4e6bfd0612
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -94,6 +94,12 @@ Only multi-line code snippets have a "Show more" button by default. Set `showMor
<CodeSnippet type="multi" {code} hideCopyButton showMoreLess={false} /> <CodeSnippet type="multi" {code} hideCopyButton showMoreLess={false} />
## Custom show more/less text
Use the `showMoreText` and `showLessText` props to override the default "Show more" and "Show less" button text.
<CodeSnippet type="multi" {code} showMoreText="Expand" showLessText="Collapse" />
## Disabled ## Disabled
The `disabled` prop applies only to the `"single"` and `"multi"` code snippet types. The `disabled` prop applies only to the `"single"` and `"multi"` code snippet types.