{"id":16955568,"url":"https://github.com/rcdexta/flxbx","last_synced_at":"2026-05-13T05:39:47.127Z","repository":{"id":57239198,"uuid":"101548591","full_name":"rcdexta/flxbx","owner":"rcdexta","description":"A minimalistic flexbox library for React","archived":false,"fork":false,"pushed_at":"2017-09-20T17:17:30.000Z","size":723,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-27T11:23:57.229Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://rcdexta.github.io/flxbx","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rcdexta.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-27T11:44:28.000Z","updated_at":"2020-06-25T15:32:50.000Z","dependencies_parsed_at":"2022-08-29T22:22:24.628Z","dependency_job_id":null,"html_url":"https://github.com/rcdexta/flxbx","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rcdexta%2Fflxbx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rcdexta%2Fflxbx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rcdexta%2Fflxbx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rcdexta%2Fflxbx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rcdexta","download_url":"https://codeload.github.com/rcdexta/flxbx/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244801137,"owners_count":20512601,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T22:12:40.782Z","updated_at":"2026-05-13T05:39:47.099Z","avatar_url":"https://github.com/rcdexta.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# flxbx\n\nA minimalistic flexbox library for React\n\n[![Build Status](https://travis-ci.org/rcdexta/flxbx.svg?branch=master)](https://travis-ci.org/rcdexta/flxbx)\n[![npm version](https://badge.fury.io/js/flxbx.svg)](https://badge.fury.io/js/flxbx)\n\n## Why?\n\nMost react libraries for flexbox are bloated. I wrote this for myself as a utility to contain the minimal directives for flexbox to quickly prototype a custom layout with a container containing multiple children each with their own flex specifications.\n\n## Features\n\n* minimalistic and light weight\n* direct wrapper over flexbox specification [see here](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout)\n\n## Getting Started\n\nUse npm or yarn to add this as dependency\n\n```bash\nnpm install -save flxbx\n```\n\nor\n\n```bash\nyarn add flxbx\n```\n\n## Usage\n\n`Flxbx` defines two components to describe the flexbox specification for parent container as well as child components.\n\nConsider the layout below:\n\n![alt tag](https://github.com/rcdexta/flxbx/raw/master/assets/parent.png)\n\nThis can be defined using the following DSL. Read through the values assigned to props to better understand the layout used. Note that `Box` is just an arbitrary component used to visually represent the effect of flex layout and is not part of the library.\n\n```jsx\n\u003cFlxBx reverse={true} justify='center' align='center'\u003e\n\t\u003cBox num={1} /\u003e\n\t\u003cBox num={2} /\u003e\n\t\u003cBox num={3} /\u003e\n\t\u003cBox num={4} /\u003e\n\u003c/FlxBx\u003e\n```\n\nTo tweak the position of individual child elements, read through the example below\n\n![alt tag](https://github.com/rcdexta/flxbx/raw/master/assets/child.png)\n\n\n```jsx\n\u003cFlxBx\u003e\n\t\u003cFlxEl element={Box} num={1} /\u003e\n\t\u003cFlxEl element={Box} num={2} align='center' /\u003e\n\t\u003cFlxEl element={Box} num={3} grow='0.4' /\u003e\n\t\u003cFlxEl element={Box} num={4} align='flex-end'/\u003e\n\u003c/FlxBx\u003e\n```\n\n`FlxEl` takes a component as element prop and passes all other props not relevant to flxbx library.\n\nPlease check the examples in the [storybook](https://rcdexta.github.io/flxbx) for detailed documentation about possible prop values\n\n## Documentation\n\n### FlxBx\n\nParent component to define the container level flex properties\n\n| Name      | Type    | Description (default value)              | Flexbox Reference                        |\n| --------- | ------- | ---------------------------------------- | ---------------------------------------- |\n| direction | string  | How flex items are placed in the flex container defining the main axis and the direction (row) | [flex-direction](https://developer.mozilla.org/en-US/docs/Web/CSS/flex-direction) |\n| reverse   | boolean | Reverse flex direction (false)           | -                                        |\n| justify   | string  | Defines how the browser distributes space between and around content items along the main axis of their container (flex-start) | [justify-content](https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content) |\n| align     | string  | defines how the browser distributes space between and around flex items along the cross-axis of their container (flex-start) | [align-items](https://developer.mozilla.org/en-US/docs/Web/CSS/align-items) |\n### FlxEl\n\nWrapper component for defining flex properties for child elements\n\n| Name    | Type   | Description (default value)              | Flexbox Reference                        |\n| ------- | ------ | ---------------------------------------- | ---------------------------------------- |\n| element | object | Actual component to be rendered as child | -                                        |\n| align   | string | aligns flex items of the current flex line overriding the [`align-items`](https://developer.mozilla.org/en-US/docs/Web/CSS/align-items) value (auto) | [align-self](https://developer.mozilla.org/en-US/docs/Web/CSS/align-self) |\n| basis   | string | specifies the flex basis which is the initial **main size** of a flex item (auto) | [flex-basis](https://developer.mozilla.org/en-US/docs/Web/CSS/flex-basis) |\n| grow    | string | specifies the flex grow factor of a flex item. It specifies what amount of space inside the flex container the item should take up (0) | [flex-grow](https://developer.mozilla.org/en-US/docs/Web/CSS/flex-grow) |\n| shrink  | string | specifies the flex shrink factor of a flex item. Flex items will shrink to fill the container according to the `flex-shrink` number, when the default width of flex items is wider than the flex container (1) | [flex-shrink](https://developer.mozilla.org/en-US/docs/Web/CSS/flex-shrink) |\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frcdexta%2Fflxbx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frcdexta%2Fflxbx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frcdexta%2Fflxbx/lists"}