ZIm/crates/ui2/src/components.rs
Marshall Bowers 393be3cedf
Extract Tab component (#3539)
This PR extracts a new `Tab` component from the tabs implementation in
the workspace.

This will allow us to reuse this component anywhere that we need to use
tabs.

Like our other newer components, the `Tab` component has a relatively
open API.

It accepts `children` (or `child`) as well as a `start_slot` and
`end_slot` to position content in the slots on either end of the
content. These slots also respect the `TabCloseSide` and will switch
positions based on this value.

<img width="763" alt="Screenshot 2023-12-07 at 12 19 42 PM"
src="https://github.com/zed-industries/zed/assets/1486634/78e4db6a-f807-431e-8777-f52f2631e6ed">

Release Notes:

- N/A
2023-12-07 12:30:43 -05:00

41 lines
677 B
Rust

mod avatar;
mod button;
mod checkbox;
mod context_menu;
mod disclosure;
mod divider;
mod icon;
mod indicator;
mod keybinding;
mod label;
mod list;
mod popover;
mod popover_menu;
mod right_click_menu;
mod stack;
mod tab;
mod tooltip;
#[cfg(feature = "stories")]
mod stories;
pub use avatar::*;
pub use button::*;
pub use checkbox::*;
pub use context_menu::*;
pub use disclosure::*;
pub use divider::*;
pub use icon::*;
pub use indicator::*;
pub use keybinding::*;
pub use label::*;
pub use list::*;
pub use popover::*;
pub use popover_menu::*;
pub use right_click_menu::*;
pub use stack::*;
pub use tab::*;
pub use tooltip::*;
#[cfg(feature = "stories")]
pub use stories::*;