-
Notifications
You must be signed in to change notification settings - Fork 24.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Overhaul the Flexbox documentation #8395
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
--- | ||
id: basics-layout | ||
title: Layout | ||
title: Layout with Flexbox | ||
layout: docs | ||
category: The Basics | ||
permalink: docs/basics-layout.html | ||
permalink: docs/flexbox.html | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we don't need to worry about breaking the bookmarks to that page. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Google. This page is one of the most visited on the site right now. People search for [react native flexbox] and it's the first link. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oops, we need a redirect then There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I mean that docs/flexbox.html is popular. docs/basics-layout.html doesnt exist yet. Previously docs/flexbox.html was the autogen flexbox doc, now it's this part of "the basics", so the links should just send people here now. |
||
next: basics-component-textinput | ||
--- | ||
|
||
A component can specify the layout of its children using the flexbox algorithm. Flexbox is designed to provide a consistent layout on different screen sizes. | ||
|
||
You will normally use a combination of `flexDirection`, `alignItems`, and `justifyContent` to achieve the right layout. | ||
|
||
> Flexbox works the same way in React Native as it does in CSS on the web, with a few exceptions. The most notable one: the defaults are different, with `flexDirection` defaulting to `column` instead of `row`, and `alignItems` defaulting to `stretch` instead of `flex-start`. | ||
> Flexbox works the same way in React Native as it does in CSS on the web, with a few exceptions. The defaults are different, with `flexDirection` defaulting to `column` instead of `row`, and `alignItems` defaulting to `stretch` instead of `flex-start`, and the `flex` parameter only supports a single number. | ||
|
||
#### Flex Direction | ||
|
||
|
@@ -99,6 +99,6 @@ class AlignItemsBasics { | |
AppRegistry.registerComponent('AwesomeProject', () => AlignItemsBasics); | ||
``` | ||
|
||
#### API Reference | ||
#### Going Deeper | ||
|
||
We've covered the basics, but there are many other styles you may need for layouts. The full list is available [here](./docs/flexbox.html). | ||
We've covered the basics, but there are many other styles you may need for layouts. The full list of props that control layout is documented [here](./docs/layout-props.html). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to say a little bit more about flex but not sure what. Perhaps more about what the positive number means.