gpui-component/docs/docs
Jason Lee 2dbfba3490
popover: Improve Popover API. (#1545)
- Add `open`, `on_open_change` method to control open state.
- Add `default_open` method.

## Break Change

This PR to rewrite the API of Popover API to make it easy to use. 

- The `content` method now can receive an element directly.

```diff
- .content(|window, cx| {
-     cx.new(|cx| {
-         PopoverContent::new(window, cx, |_, _| {
-             div().child("This popover content.")
-         })
-     })
- })
+ .content(|state, window, cx| {
+     div().child("This popover content.")
+ })
```

- And you can also just use `child` and `children` to add child
elements.

```rs
Popover::new("my-popover")
    .trigger(Button::new("trigger").label("Open Popover"))
    .child("This popover content.")
```

- Removed `PopoverContent`, and changed `Popover` default paddings to
`p_3`.
2025-11-11 17:45:30 +08:00
..
components popover: Improve Popover API. (#1545) 2025-11-11 17:45:30 +08:00
assets.md chore: Standardize the overall API and improve docs. (#1516) 2025-11-05 19:10:30 +08:00
context.md docs: Add Context & ElementId doc. (#1460) 2025-10-29 23:37:26 +08:00
element_id.md docs: Add Context & ElementId doc. (#1460) 2025-10-29 23:37:26 +08:00
getting-started.md dialog: Rename Modal to Dialog. (#1538) 2025-11-07 17:25:55 +08:00
index.md docs: Update version to v0.4.0-preview1 in docs. (#1534) 2025-11-06 22:35:38 +08:00
installation.md docs: Update version to v0.4.0-preview1 in docs. (#1534) 2025-11-06 22:35:38 +08:00
root.md dialog: Rename Modal to Dialog. (#1538) 2025-11-07 17:25:55 +08:00
theme.md docs: Add Theme, RootView doc. (#1408) 2025-10-22 00:02:36 +08:00