Flex
Flex description.
Props
Flex properties
Property | Description | Type | Default | Version |
---|---|---|---|---|
wrap | Should flex items wrap? | boolean | false | |
width | Width of the flex container | number | ||
direction | Flex direction | row column | row | |
alignItems | Set flex container align-items property | flex-start flex-end center baseline stretch | flex-start | |
alignContent | Align flex items on cross-axis | flex-start flex-end center space-between space-around , etc | stretch | |
justify | Align flex items on main-axis | flex-start flex-end center space-between space-around , space-evenly | center |
Usage
Basic Flex
import { Flex, Image, BrowserWindow } from 'camara';render(<BrowserWindow docs><Flex><Imagewidth="25%"imageUrl="https://source.unsplash.com/V_WBdOLOgJU/600x500"imageAlt="woman in orange knit cap and blue jacket"/><Imagewidth="25%"imageUrl="https://source.unsplash.com/V_WBdOLOgJU/600x500"imageAlt="woman in orange knit cap and blue jacket"/><Imagewidth="25%"imageUrl="https://source.unsplash.com/V_WBdOLOgJU/600x500"imageAlt="woman in orange knit cap and blue jacket"/><Imagewidth="25%"imageUrl="https://source.unsplash.com/V_WBdOLOgJU/600x500"imageAlt="woman in orange knit cap and blue jacket"/></Flex></BrowserWindow>);
Direction - Column
import { Flex, Image, BrowserWindow } from 'camara';render(<BrowserWindow docs><Flex direction="column"><Imagewidth={100}imageUrl="https://source.unsplash.com/V_WBdOLOgJU/600x500"imageAlt="woman in orange knit cap and blue jacket"/><Imagewidth={100}imageUrl="https://source.unsplash.com/V_WBdOLOgJU/600x500"imageAlt="woman in orange knit cap and blue jacket"/><Imagewidth={100}imageUrl="https://source.unsplash.com/V_WBdOLOgJU/600x500"imageAlt="woman in orange knit cap and blue jacket"/></Flex></BrowserWindow>);
Direction - Row
import { Flex, Image, BrowserWindow } from 'camara';render(<BrowserWindow docs><Flex direction="row"><Imagewidth={100}imageUrl="https://source.unsplash.com/V_WBdOLOgJU/600x500"imageAlt="woman in orange knit cap and blue jacket"/><Imagewidth={100}imageUrl="https://source.unsplash.com/V_WBdOLOgJU/600x500"imageAlt="woman in orange knit cap and blue jacket"/><Imagewidth={100}imageUrl="https://source.unsplash.com/V_WBdOLOgJU/600x500"imageAlt="woman in orange knit cap and blue jacket"/></Flex></BrowserWindow>);
Justify
Space Between
import { Flex, Image, BrowserWindow } from 'camara';render(<BrowserWindow docs><Flex direction="row" justify="space-between"><Imagewidth={100}imageUrl="https://source.unsplash.com/V_WBdOLOgJU/600x500"imageAlt="woman in orange knit cap and blue jacket"/><Imagewidth={100}imageUrl="https://source.unsplash.com/V_WBdOLOgJU/600x500"imageAlt="woman in orange knit cap and blue jacket"/><Imagewidth={100}imageUrl="https://source.unsplash.com/V_WBdOLOgJU/600x500"imageAlt="woman in orange knit cap and blue jacket"/></Flex></BrowserWindow>);
Space Around
import { Flex, Image, BrowserWindow } from 'camara';render(<BrowserWindow docs><Flex direction="row" justify="space-around"><Imagewidth={100}imageUrl="https://source.unsplash.com/V_WBdOLOgJU/600x500"imageAlt="woman in orange knit cap and blue jacket"/><Imagewidth={100}imageUrl="https://source.unsplash.com/V_WBdOLOgJU/600x500"imageAlt="woman in orange knit cap and blue jacket"/><Imagewidth={100}imageUrl="https://source.unsplash.com/V_WBdOLOgJU/600x500"imageAlt="woman in orange knit cap and blue jacket"/></Flex></BrowserWindow>);
Space Evenly
import { Flex, Image, BrowserWindow } from 'camara';render(<BrowserWindow docs><Flex direction="row" justify="space-evenly"><Imagewidth={100}imageUrl="https://source.unsplash.com/V_WBdOLOgJU/600x500"imageAlt="woman in orange knit cap and blue jacket"/><Imagewidth={100}imageUrl="https://source.unsplash.com/V_WBdOLOgJU/600x500"imageAlt="woman in orange knit cap and blue jacket"/><Imagewidth={100}imageUrl="https://source.unsplash.com/V_WBdOLOgJU/600x500"imageAlt="woman in orange knit cap and blue jacket"/></Flex></BrowserWindow>);
Center
import { Flex, Image, BrowserWindow } from 'camara';render(<BrowserWindow docs><Flex direction="row" justify="center"><Imagewidth={100}imageUrl="https://source.unsplash.com/V_WBdOLOgJU/600x500"imageAlt="woman in orange knit cap and blue jacket"/><Imagewidth={100}imageUrl="https://source.unsplash.com/V_WBdOLOgJU/600x500"imageAlt="woman in orange knit cap and blue jacket"/><Imagewidth={100}imageUrl="https://source.unsplash.com/V_WBdOLOgJU/600x500"imageAlt="woman in orange knit cap and blue jacket"/></Flex></BrowserWindow>);
Flex Start
import { Flex, Image, BrowserWindow } from 'camara';render(<BrowserWindow docs><Flex direction="row" justify="flex-start"><Imagewidth={100}imageUrl="https://source.unsplash.com/V_WBdOLOgJU/600x500"imageAlt="woman in orange knit cap and blue jacket"/><Imagewidth={100}imageUrl="https://source.unsplash.com/V_WBdOLOgJU/600x500"imageAlt="woman in orange knit cap and blue jacket"/><Imagewidth={100}imageUrl="https://source.unsplash.com/V_WBdOLOgJU/600x500"imageAlt="woman in orange knit cap and blue jacket"/></Flex></BrowserWindow>);
Flex End
import { Flex, Image, BrowserWindow } from 'camara';render(<BrowserWindow docs><Flex direction="row" justify="flex-end"><Imagewidth={100}imageUrl="https://source.unsplash.com/V_WBdOLOgJU/600x500"imageAlt="woman in orange knit cap and blue jacket"/><Imagewidth={100}imageUrl="https://source.unsplash.com/V_WBdOLOgJU/600x500"imageAlt="woman in orange knit cap and blue jacket"/><Imagewidth={100}imageUrl="https://source.unsplash.com/V_WBdOLOgJU/600x500"imageAlt="woman in orange knit cap and blue jacket"/></Flex></BrowserWindow>);
Wrap
import { Flex, Image, BrowserWindow } from 'camara';render(<BrowserWindow docs><Flex wrap direction="row" justify="space-between"><Imagewidth={170}imageUrl="https://source.unsplash.com/V_WBdOLOgJU/600x500"imageAlt="woman in orange knit cap and blue jacket"/><Imagewidth={170}imageUrl="https://source.unsplash.com/V_WBdOLOgJU/600x500"imageAlt="woman in orange knit cap and blue jacket"/><Imagewidth={170}imageUrl="https://source.unsplash.com/V_WBdOLOgJU/600x500"imageAlt="woman in orange knit cap and blue jacket"/><Imagewidth={170}imageUrl="https://source.unsplash.com/V_WBdOLOgJU/600x500"imageAlt="woman in orange knit cap and blue jacket"/><Imagewidth={170}imageUrl="https://source.unsplash.com/V_WBdOLOgJU/600x500"imageAlt="woman in orange knit cap and blue jacket"/><Imagewidth={170}imageUrl="https://source.unsplash.com/V_WBdOLOgJU/600x500"imageAlt="woman in orange knit cap and blue jacket"/><Imagewidth={170}imageUrl="https://source.unsplash.com/V_WBdOLOgJU/600x500"imageAlt="woman in orange knit cap and blue jacket"/><Imagewidth={170}imageUrl="https://source.unsplash.com/V_WBdOLOgJU/600x500"imageAlt="woman in orange knit cap and blue jacket"/></Flex></BrowserWindow>);
Align Content
import { Flex, Image, BrowserWindow } from 'camara';render(<BrowserWindow docs><Flexwrapdirection="row"justify="space-between"alignContent="space-between"><Imagewidth={170}imageUrl="https://source.unsplash.com/V_WBdOLOgJU/600x500"imageAlt="woman in orange knit cap and blue jacket"/><Imagewidth={170}imageUrl="https://source.unsplash.com/V_WBdOLOgJU/600x500"imageAlt="woman in orange knit cap and blue jacket"/><Imagewidth={170}imageUrl="https://source.unsplash.com/V_WBdOLOgJU/600x500"imageAlt="woman in orange knit cap and blue jacket"/><Imagewidth={170}imageUrl="https://source.unsplash.com/V_WBdOLOgJU/600x500"imageAlt="woman in orange knit cap and blue jacket"/><Imagewidth={170}imageUrl="https://source.unsplash.com/V_WBdOLOgJU/600x500"imageAlt="woman in orange knit cap and blue jacket"/><Imagewidth={170}imageUrl="https://source.unsplash.com/V_WBdOLOgJU/600x500"imageAlt="woman in orange knit cap and blue jacket"/><Imagewidth={170}imageUrl="https://source.unsplash.com/V_WBdOLOgJU/600x500"imageAlt="woman in orange knit cap and blue jacket"/><Imagewidth={170}imageUrl="https://source.unsplash.com/V_WBdOLOgJU/600x500"imageAlt="woman in orange knit cap and blue jacket"/></Flex></BrowserWindow>);