Comments (4)
I started working on this and got a few questions for the first version:
1. Is this the complete API? It looks a bit limiting to have only these props (I extracted them in an interface):
interface IGridProps {
as?: string
children?: ReactNode
className?: string
columns?: string | number
content?: ReactNode
rows?: string
}
2. Shouldn't we add a sub-component for children (GridItem
)? On CSS Tricks for Grid there are plenty of examples on how to style individual items; maybe add orientation (justify-self, align-self, place-self, etc)? or should we keep that for v2?
3. Related to 2; how do we align items?
- Do we add any props to the
Grid
component? - Do we add
GridItem
sub-component to make it more visible or other options? - Do we create some default alignment (everything centered let's say) and iterate from there?
4. Children and content
- What should be the API for content initially and how do we render it in the DOM?
- Should we manipulate children in any way to add correct grid item styling? (e.g.: going through children and adding CSS classes)
from fluent-ui-react.
rows (quantity)
Looking back, this is short sighted. If you have a grid with a fixed height, you very well may want to equally divide up that vertical space by passing a number of rows. Let's give the same API to rows as columns has.
Grid Item
Yes, let's save for a future PR.
Should we manipulate children in any way to add correct grid item styling?
Best practice is to never parse/loop over children. This is because they can be wrapped in HOCs making it difficult to work with as you don't know what component you might encounter or what features they support.
We'll use the CSS grid syntax from the parent to position children. Once we get to fine grained positioning for one off children, we'll likely have a GridItem type of component. Similar to how SUIR has a Grid and Grid.Column/Grid.Row.
from fluent-ui-react.
Opened a PR for it, WIP #15
@levithomason
from fluent-ui-react.
We need to ensure the grid renders correctly with the requirements here: #29
from fluent-ui-react.
Related Issues (20)
- Memory leaks in FocusZone due to DOM object references not getting cleaned up
- Dropdown onSelectedChanged typings incorrect
- Bundle size: Single `themes` import imports all themes
- Bundle size: theme import imports several components HOT 2
- Toolbar with menu: trigger button always opens menu instead of toggling it
- Input's fluid property no effect when it is in a Form.Field?
- Dropdown value is [object Object] when selecting an item that is an object using DropdownItemProps HOT 3
- Carousel throws getItemPositionText is not a function
- How to change the Dropdown's container width? It is 22.25rem for now.
- Animation with no children throws
- Can't add custom colors to colorScheme? HOT 1
- Which technology to choose: office-ui-fabric-react vs fluent-ui-react HOT 1
- Toolbar overflow menu is misaligned/shifting rest of a page when clicked
- Tooltip: wrong outline on Button
- Popup: `offset` breaks arrow pointer
- [RFC] Implementing reveal highlight
- Popup: pointing beak is broken on edges HOT 1
- AccordionTitle content is not exposed as a slot
- README.md: Broken link in the "Why?" section
- Safari: Wrong focus indicator on Input
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fluent-ui-react.