mirror of
https://github.com/phuoc-ng/csslayout.git
synced 2025-10-24 11:16:27 +02:00
106 lines
3.9 KiB
TypeScript
106 lines
3.9 KiB
TypeScript
import React from 'react';
|
|
import { Helmet } from 'react-helmet';
|
|
|
|
import DetailsLayout from '../../layouts/DetailsLayout';
|
|
import BrowserFrame from '../../placeholders/BrowserFrame';
|
|
import Circle from '../../placeholders/Circle';
|
|
|
|
const Details: React.FC<{}> = () => {
|
|
return (
|
|
<DetailsLayout title="Search box">
|
|
<Helmet>
|
|
<meta name="description" content="Create a search box with CSS flexbox" />
|
|
<meta name="keywords" content="css flexbox, css search box" />
|
|
</Helmet>
|
|
<div style={{ padding: '64px 32px' }}>
|
|
<BrowserFrame
|
|
content={(
|
|
<div
|
|
style={{
|
|
alignItems: 'center',
|
|
display: 'flex',
|
|
flexDirection: 'column',
|
|
height: '100%',
|
|
justifyContent: 'center',
|
|
padding: '8px',
|
|
}}
|
|
>
|
|
<div style={{ width: '256px' }}>
|
|
<div
|
|
style={{
|
|
border: '1px solid rgba(0, 0, 0, 0.3)',
|
|
borderRadius: '2px',
|
|
display: 'flex',
|
|
marginBottom: '16px',
|
|
}}
|
|
>
|
|
<input
|
|
type="text"
|
|
placeholder="Search"
|
|
style={{
|
|
borderColor: 'transparent',
|
|
flex: 1,
|
|
padding: '4px',
|
|
}}
|
|
/>
|
|
<div style={{ padding: '8px' }}>
|
|
<Circle />
|
|
</div>
|
|
</div>
|
|
|
|
<div
|
|
style={{
|
|
border: '1px solid rgba(0, 0, 0, 0.3)',
|
|
borderRadius: '2px',
|
|
display: 'flex',
|
|
flexDirection: 'row-reverse',
|
|
}}
|
|
>
|
|
<input
|
|
type="text"
|
|
placeholder="Search"
|
|
style={{
|
|
borderColor: 'transparent',
|
|
flex: 1,
|
|
padding: '4px',
|
|
}}
|
|
/>
|
|
<div style={{ padding: '8px' }}>
|
|
<Circle />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
)}
|
|
source={`
|
|
<div style="
|
|
display: flex;
|
|
|
|
/* If you want to place the icon before the text input */
|
|
flex-direction: row-reverse;
|
|
|
|
/* Border */
|
|
border: 1px solid rgba(0, 0, 0, 0.3);
|
|
">
|
|
<!-- Text input -->
|
|
<input
|
|
type="text"
|
|
style="
|
|
border-color: transparent;
|
|
/* Take available width */
|
|
flex: 1;
|
|
"
|
|
/>
|
|
|
|
<!-- Search icon sticks to the left or right -->
|
|
...
|
|
</div>
|
|
`}
|
|
/>
|
|
</div>
|
|
</DetailsLayout>
|
|
);
|
|
};
|
|
|
|
export default Details;
|