gpui-component/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
..
.vitepress slider: Add option to choose between linear and logarithmic scale (#1543) 2025-11-10 02:56:09 +00:00
data docs: Improve docs add more details. (#1447) 2025-10-29 02:41:28 +00:00
docs popover: Improve Popover API. (#1545) 2025-11-11 17:45:30 +08:00
public docs: Update dark theme logo. (#1412) 2025-10-22 22:09:30 +08:00
src docs: Switch to use VitePress. (#1405) 2025-10-21 15:18:41 +08:00
.gitignore docs: Add Context & ElementId doc. (#1460) 2025-10-29 23:37:26 +08:00
bun.lock slider: Add option to choose between linear and logarithmic scale (#1543) 2025-11-10 02:56:09 +00:00
contributors.md docs: Update docs links. 2025-10-22 22:27:49 +08:00
contributors.vue docs: Improve docs add more details. (#1447) 2025-10-29 02:41:28 +00:00
index.md docs: Update version to v0.4.0-preview1 in docs. (#1534) 2025-11-06 22:35:38 +08:00
index.vue docs: Update docs website style. (#1488) 2025-11-03 22:18:18 +08:00
package.json slider: Add option to choose between linear and logarithmic scale (#1543) 2025-11-10 02:56:09 +00:00
postcss.config.mjs docs: Switch to use VitePress. (#1405) 2025-10-21 15:18:41 +08:00