forked from primefaces/primereact
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
87 changed files
with
6,633 additions
and
1,508 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
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,77 @@ | ||
import { DocSectionCode } from '@/components/doc/common/docsectioncode'; | ||
import { DocSectionText } from '@/components/doc/common/docsectiontext'; | ||
import Link from 'next/link'; | ||
|
||
export function TailwindDoc(props) { | ||
const code = { | ||
basic: ` | ||
const Tailwind = { | ||
iconfield: { | ||
root: { | ||
className: classNames('relative') | ||
} | ||
}, | ||
inputicon: { | ||
root: ({ context }) => ({ | ||
className: classNames('absolute top-1/2 -mt-2', { | ||
'left-2': context.iconPosition === 'left', | ||
'right-2': context.iconPosition === 'right' | ||
}) | ||
}) | ||
}, | ||
// For each input wrapped with IconField you will need to add styling. | ||
// The following is an example for InputText | ||
inputtext: { | ||
root: ({ props, context }) => ({ | ||
className: classNames( | ||
// Extend the root stylings with the following: | ||
{ | ||
'pl-8': context.iconPosition === 'left', | ||
'pr-8': props.iconPosition === 'right' | ||
} | ||
) | ||
}) | ||
}, | ||
} | ||
` | ||
}; | ||
|
||
const code2 = { | ||
javascript: ` | ||
import React from 'react'; | ||
import { IconField } from 'primereact/iconfield'; | ||
import { InputIcon } from 'primereact/inputicon'; | ||
import { InputText } from 'primereact/inputtext'; | ||
export default function BasicDemo() { | ||
return ( | ||
<div className="flex gap-3"> | ||
<IconField iconPosition="left"> | ||
<InputIcon className="pi pi-search"> </InputIcon> | ||
<InputText placeholder="Search" /> | ||
</IconField> | ||
<IconField> | ||
<InputIcon className="pi pi-spin pi-spinner"> </InputIcon> | ||
<InputText /> | ||
</IconField> | ||
</div> | ||
) | ||
} | ||
` | ||
}; | ||
|
||
return ( | ||
<> | ||
<DocSectionText {...props}> | ||
<p> | ||
PrimeReact offers a built-in Tailwind theme to get you started quickly. The default values related to the component are displayed below. The component can easily be styled with your own design based on Tailwind utilities, see the{' '} | ||
<Link href="/tailwind">Tailwind Customization</Link> section for an example. | ||
</p> | ||
<DocSectionCode code={code} hideToggleCode import hideStackBlitz /> | ||
<p>A playground sample with the pre-built Tailwind theme.</p> | ||
<DocSectionCode code={code2} embedded /> | ||
</DocSectionText> | ||
</> | ||
); | ||
} |
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,55 @@ | ||
import { DocSectionCode } from '@/components/doc/common/docsectioncode'; | ||
import { DocSectionText } from '@/components/doc/common/docsectiontext'; | ||
import Link from 'next/link'; | ||
|
||
export function TailwindDoc(props) { | ||
const code = { | ||
basic: ` | ||
const Tailwind = { | ||
inputotp: { | ||
root: { className: 'flex items-center gap-2' }, | ||
input: { | ||
root: { | ||
className: classNames( | ||
'box-border text-center w-10 h-11 p-3 text-slate-900 border border-gray-300 rounded-lg transition-all duration-200', | ||
'hover:border-cyan-500', | ||
'focus:border-cyan-500 focus:shadow-[0_0_0_0.2rem_#a5f3fc] focus:outline-0 focus:outline-offset-0' | ||
) | ||
} | ||
} | ||
} | ||
} | ||
` | ||
}; | ||
|
||
const code2 = { | ||
javascript: ` | ||
import React, { useState } from 'react'; | ||
import { InputOtp } from 'primereact/inputotp'; | ||
export default function BasicDemo() { | ||
const [token, setTokens] = useState(); | ||
return ( | ||
<div className="card flex justify-content-center"> | ||
<InputOtp value={token} onChange={(e) => setTokens(e.value)}/> | ||
</div> | ||
); | ||
} | ||
` | ||
}; | ||
|
||
return ( | ||
<> | ||
<DocSectionText {...props}> | ||
<p> | ||
PrimeReact offers a built-in Tailwind theme to get you started quickly. The default values related to the component are displayed below. The component can easily be styled with your own design based on Tailwind utilities, see the{' '} | ||
<Link href="/tailwind">Tailwind Customization</Link> section for an example. | ||
</p> | ||
<DocSectionCode code={code} hideToggleCode import hideStackBlitz /> | ||
<p>A playground sample with the pre-built Tailwind theme.</p> | ||
<DocSectionCode code={code2} embedded /> | ||
</DocSectionText> | ||
</> | ||
); | ||
} |
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
Oops, something went wrong.