Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
16
rated 0 times [  20] [ 4]  / answers: 1 / hits: 20186  / 7 Years ago, thu, june 22, 2017, 12:00:00

I´m using Semantic UI together with ReactJS using the official semantic-ui-react.



I want to build a Trello like app and put cards on it. The cards are going to be stacked for one Topic and shall be scrollable vertically inside one topic and horizontally on all topics.



I´m using the code below and naturally I´m getting stacked segments, with large width, and no scroll controls.



import React, { Component } from 'react';
import { Segment, Card, Header } from 'semantic-ui-react';


class TestPanel extends Component {

getCards = () => {

let i = 0;
let cards = [];

for (i = 0; i < 10; i++) {

let card = (
<Card key={i}>
<Card.Header>
Item {i}
</Card.Header>
<Card.Meta>
ItemMeta {i}
</Card.Meta>
</Card>
);
cards.push(card);
}

return cards;
};

render () {

let cards = this.getCards();

return (
<div>
<Segment>
<Segment>
<Header>Segment 1</Header>
{cards}
</Segment>
<Segment>
<Header>Segment 2</Header>
{cards}
</Segment>
</Segment>
</div>
);
}

}

export default TestPanel;


I´ve checked segment and there is no scrollable option on any commands.



So, how can I make the outer segment to scroll horizontally and each card segment scroll vertically. Thanks for helping.


More From » css

 Answers
104

Try this, works for me:



  <Segment style={{overflow: 'auto', maxHeight: 200 }}>
</Segment>

[#57338] Tuesday, June 20, 2017, 7 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jadon

Total Points: 488
Total Questions: 105
Total Answers: 105

Location: Trinidad and Tobago
Member since Thu, Dec 1, 2022
2 Years ago
;