patternfly_yew/utils/raw.rs
1use crate::prelude::ChildrenProperties;
2use yew::prelude::*;
3
4/// A general purpose "raw" component.
5///
6/// ## Idea
7///
8/// Some components require specific children. This is sometimes enforced using Rust's type system.
9/// For example, the [`patternfly_yew::prelude::Card`] component requires either a
10/// [`patternfly_yew::prelude::CardBody`] or [`patternfly_yew::prelude::Divider`]. And this is
11/// enforced through Rust types. This ensures that components work as intended, but may be limiting
12/// in some cases.
13///
14/// This component can be used (if a component supports it) as an alternative to the strongly typed
15/// children, allowing to inject any component or element. Be aware, this might break things, but
16/// allows for full control, like `unsafe`.
17///
18/// ## Children
19///
20/// The components accepts any and any number of components.
21#[function_component(Raw)]
22pub fn raw(props: &ChildrenProperties) -> Html {
23 props.children.clone()
24}