-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(carousel): add vertical mode for carousel (#137)
* feat(carousel): add vertical mode for carousel * fix: change for code reviews * fix: change for code reviews * chore: new version * docs(carousel): add html source code for vertical
- Loading branch information
Showing
6 changed files
with
201 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'@banana-ui/banana': patch | ||
'@banana-ui/react': patch | ||
--- | ||
|
||
add vertical mode for carousel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/** | ||
* title: 垂直展示 | ||
* description: 当需要垂直展示时,需要手动指定容器高度(设置对应css变量`--banana-carousel-vertical-height`) | ||
*/ | ||
|
||
import { Carousel } from '@banana-ui/react'; | ||
|
||
export default function Vertical() { | ||
const style = ` | ||
.demo-slide--vertical { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
background: linear-gradient(to bottom right, #5193e9, #0e61cd); | ||
color: #fff; | ||
font-size: 48px; | ||
} | ||
.container { | ||
--banana-carousel-vertical-height: 300px; | ||
} | ||
`; | ||
|
||
return ( | ||
<> | ||
<style>{style}</style> | ||
<Carousel className="container" vertical> | ||
<div className="demo-slide--vertical">1</div> | ||
<div className="demo-slide--vertical">2</div> | ||
<div className="demo-slide--vertical">3</div> | ||
<div className="demo-slide--vertical">4</div> | ||
<div className="demo-slide--vertical">5</div> | ||
</Carousel> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.