-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4257 from primefaces/issue-4256
Add custom icons page
- Loading branch information
Showing
11 changed files
with
150 additions
and
85 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { DocSectionCode } from '../common/docsectioncode'; | ||
import { DocSectionText } from '../common/docsectiontext'; | ||
|
||
export function FontAwesomeDoc(props) { | ||
const code = { | ||
basic: ` | ||
<Dropdown dropdownIcon={<i class="fa-light fa-chevron-down"></i>} /> | ||
` | ||
}; | ||
|
||
return ( | ||
<> | ||
<DocSectionText {...props}> | ||
<p> | ||
<a href="https://fontawesome.com/">Font Awesome</a> is a popular icon library with a wide range of icons. | ||
</p> | ||
</DocSectionText> | ||
<DocSectionCode code={code} hideToggleCode import hideCodeSandbox hideStackBlitz /> | ||
</> | ||
); | ||
} |
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,19 @@ | ||
import { DocSectionCode } from '../common/docsectioncode'; | ||
import { DocSectionText } from '../common/docsectiontext'; | ||
|
||
export function ImageDoc(props) { | ||
const code = { | ||
basic: ` | ||
<Dropdown dropdownIcon={<img alt="dropdown icon" src="/icons/arrow_down.png" />} /> | ||
` | ||
}; | ||
|
||
return ( | ||
<> | ||
<DocSectionText {...props}> | ||
<p>Any time of image can be used as an icon.</p> | ||
</DocSectionText> | ||
<DocSectionCode code={code} hideToggleCode import hideCodeSandbox hideStackBlitz /> | ||
</> | ||
); | ||
} |
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,21 @@ | ||
import { DocSectionCode } from '../common/docsectioncode'; | ||
import { DocSectionText } from '../common/docsectiontext'; | ||
|
||
export function MaterialDoc(props) { | ||
const code = { | ||
basic: ` | ||
<Dropdown dropdownIcon={<img alt="dropdown icon" src="/icons/arrow_down.png" />} /> | ||
` | ||
}; | ||
|
||
return ( | ||
<> | ||
<DocSectionText {...props}> | ||
<p> | ||
<a href="https://fonts.google.com/icons">Material icons</a> is the official icon library based on Google Material Design. | ||
</p> | ||
</DocSectionText> | ||
<DocSectionCode code={code} hideToggleCode import hideCodeSandbox hideStackBlitz /> | ||
</> | ||
); | ||
} |
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,23 @@ | ||
import { DocSectionCode } from '../common/docsectioncode'; | ||
import { DocSectionText } from '../common/docsectiontext'; | ||
|
||
export function SVGDoc(props) { | ||
const code = { | ||
basic: ` | ||
<Dropdown dropdownIcon={<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> | ||
<g id="chevron-down"> | ||
<path d="M12,15.25a.74.74,0,0,1-.53-.22l-5-5A.75.75,0,0,1,7.53,9L12,13.44,16.47,9A.75.75,0,0,1,17.53,10l-5,5A.74.74,0,0,1,12,15.25Z"/> | ||
</g> | ||
</svg>} /> | ||
` | ||
}; | ||
|
||
return ( | ||
<> | ||
<DocSectionText {...props}> | ||
<p>Inline SVGs are embedded inside the dom.</p> | ||
</DocSectionText> | ||
<DocSectionCode code={code} hideToggleCode import hideCodeSandbox hideStackBlitz /> | ||
</> | ||
); | ||
} |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { DocComponent } from '../../components/doc/common/doccomponent'; | ||
import { FontAwesomeDoc } from '../../components/doc/customicons/fontawesomedoc'; | ||
import { ImageDoc } from '../../components/doc/customicons/imagedoc'; | ||
import { MaterialDoc } from '../../components/doc/customicons/materialdoc'; | ||
import { SVGDoc } from '../../components/doc/customicons/svgdoc'; | ||
|
||
const ContextMenuDemo = () => { | ||
const docs = [ | ||
{ | ||
id: 'material', | ||
label: 'Material', | ||
component: MaterialDoc | ||
}, | ||
{ | ||
id: 'fontawesome', | ||
label: 'Font Awesome', | ||
component: FontAwesomeDoc | ||
}, | ||
{ | ||
id: 'svg', | ||
label: 'SVG', | ||
component: SVGDoc | ||
}, | ||
{ | ||
id: 'image', | ||
label: 'Image', | ||
component: ImageDoc | ||
} | ||
]; | ||
|
||
return <DocComponent title="Custom Icons - PrimeReact" header="Custom Icons" description="PrimeReact components can be used with any icon library using the templating features." componentDocs={docs} hideTabMenu />; | ||
}; | ||
|
||
export default ContextMenuDemo; |
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