patternfly_yew/components/content.rs
1//! Content wrapper
2use yew::prelude::*;
3
4/// Properties for [`Content`]
5#[derive(Clone, PartialEq, Properties)]
6pub struct ContentProperties {
7 #[prop_or_default]
8 pub id: Option<AttrValue>,
9
10 #[prop_or_default]
11 pub children: Html,
12}
13
14/// Content wrapper component
15///
16/// *NOTE:* In PatternFly, this is documented as "Text".
17///
18/// > A **text** component can wrap any static HTML content you want to place on your page to provide correct formatting when using standard HTML tags.
19///
20/// See: <https://www.patternfly.org/components/text/html>
21///
22/// ## Properties
23///
24/// Defined by [`ContentProperties`].
25#[function_component(Content)]
26pub fn content(props: &ContentProperties) -> Html {
27 html! { <div class="pf-v6-c-content" id={&props.id}>{ props.children.clone() }</div> }
28}