-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Accordion): add
icon
shorthand for AccordionTitle (#3417)
* docs(AccordionExampleStandardShorthand): Custom Title Icon Example Added an example on how to add a custom icon via the standard Shorthand * fixed lint issues * feat(Accordion): add `icon` shorthand for AccordionTitle * fix typings & style * fix tests * fix types
- Loading branch information
1 parent
ab582ed
commit 0d28f12
Showing
6 changed files
with
76 additions
and
13 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
docs/src/examples/modules/Accordion/Advanced/AccordionExampleIconShorthand.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import React from 'react' | ||
import { Accordion } from 'semantic-ui-react' | ||
|
||
const panels = [ | ||
{ | ||
key: 'acquire-dog', | ||
title: { | ||
content: 'How do you acquire a dog?', | ||
icon: 'question', | ||
}, | ||
content: { | ||
content: ( | ||
<span> | ||
Three common ways for a prospective owner to acquire a dog is from pet | ||
shops, private owners, or shelters. | ||
</span> | ||
), | ||
}, | ||
}, | ||
{ | ||
key: 'care-for-dogs', | ||
title: { | ||
content: 'How do I care for a dog?', | ||
icon: 'question', | ||
}, | ||
content: { | ||
content: ( | ||
<span> | ||
It is entirely acceptable to feed your dog a pure kibble diet. Or you | ||
can mix their diet up with some cooked or raw meat, fish, vegetables | ||
and rice. | ||
</span> | ||
), | ||
}, | ||
}, | ||
] | ||
|
||
const AccordionExampleIconShorthand = () => ( | ||
<Accordion defaultActiveIndex={0} panels={panels} /> | ||
) | ||
|
||
export default AccordionExampleIconShorthand |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters