-
Notifications
You must be signed in to change notification settings - Fork 4.1k
I want carousel in semantic ui react #2715
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
Comments
There is no carousel currently. We're a bit tied here as there is a fair amount of CSS required for this and we do not control the CSS in this repo. I see three options:
I have no availability for this, but I'm willing to help with PRs. |
I've got a carousel component that I've created that is not necessarily SUI structured markup, but easily creates carousel slides from each rendered child. I'd consider open sourcing it into SUIR but the work to do this would not be something I would be able to do until we achieve #2 above. |
Yes, the DateTime suffers from similar difficulties. Owning our own styling will be a huge pick me up. |
I need the
carousel too |
Hi, |
@xReaven not until v2 of SUIR is done. This is probably at least 6 months out. For future reference, If there is ever any work happening on a task, it will show up in the task history as linked pull requests. |
Not a Carousel pre se, but works well in a Parent <Feed.Extra>
<Carousel photos={item.Photos} />
</Feed.Extra> "Carousel" class Viewer extends React.PureComponent {
state = {
index: this.props.index
};
componentDidMount() {
document.addEventListener('keydown', this.handleKey, false);
}
componentWillUnmount() {
document.removeEventListener('keydown', this.handleKey, false);
}
handleKey = ({ key }) => {
if (key === 'ArrowRight') {
this.flip(1);
}
if (key === 'ArrowLeft') {
this.flip(-1);
}
};
flip(val) {
this.setState(({ index }) => {
let target = index + val;
const { photos } = this.props;
if (target >= photos.length) {
target = 0;
}
if (target < 0) {
target = photos.length - 1;
}
return { index: target };
});
}
render() {
const { photos } = this.props;
const { index } = this.state;
const { path } = photos[index];
const url = getUrl(path);
return (
<Modal.Content image scrolling>
<Image wrapped src={url} />
</Modal.Content>
);
}
}
const Photo = ({ path, photos, index }) => {
const url = getUrl(path);
return (
<Modal
size="fullscreen"
trigger={<Image rounded src={url} alt="general" />}
basic
scrolling
content={<Viewer photos={photos} index={index} />}
actions={[{ key: 'done', content: 'OK', positive: true }]}
/>
);
};
const Carousel = ({ photos }) => (
<Image.Group size="small">
{photos && photos.map && photos.map(({ meta: { asset }, path }, index) => (
<Photo key={asset} path={path} photos={photos} index={index} />
))}
</Image.Group>
);
export default Carousel; |
I recently added a prototype (#3372) how to combine SUIR and pure-react-carousel, it provides a well designed components for carousels. CodeSandbox: https://codesandbox.io/s/43pv7wm6n9 For now, this looks like a best possible solution because |
i have created a carousel component for semantic ui react you can check it out |
@AramRafeq |
I want carousel in semantic ui react but I am unable to see there please help.
The text was updated successfully, but these errors were encountered: