<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to use the Storybook UI Components in your own custom Experience Builder Widget? in ArcGIS Experience Builder Questions</title>
    <link>https://community.esri.com/t5/arcgis-experience-builder-questions/how-to-use-the-storybook-ui-components-in-your-own/m-p/1302559#M7369</link>
    <description>&lt;P&gt;Did you import CardBody?&lt;/P&gt;&lt;P&gt;import {CardBody} from 'jimu-ui'&lt;/P&gt;&lt;P&gt;&amp;lt;CapitalizedElements&amp;gt;&amp;lt;/CapitalizedElements&amp;gt; in React are React components and need to be defined or imported in the TSX/JSX file they are used in.&lt;/P&gt;</description>
    <pubDate>Fri, 23 Jun 2023 17:30:10 GMT</pubDate>
    <dc:creator>JeffreyThompson2</dc:creator>
    <dc:date>2023-06-23T17:30:10Z</dc:date>
    <item>
      <title>How to use the Storybook UI Components in your own custom Experience Builder Widget?</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/how-to-use-the-storybook-ui-components-in-your-own/m-p/1302540#M7365</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P data-unlink="true"&gt;I'm trying to create a custom Experience Builder widget. In this widget I would like to use the Jimu UI Library as described &lt;A href="https://developers.arcgis.com/experience-builder/guide/widget-ui/#using-the-jimu-ui-library" target="_self"&gt;here&lt;/A&gt;. My starting point was the 'simple' widget in the latest Experience Builder developer edition. In my widget I would like to show a simple card as in described in &lt;A href="https://developers.arcgis.com/experience-builder/storybook/?path=/story/components-jimu-ui-index-card--basic" target="_self"&gt;Storybook&lt;/A&gt;.&lt;/P&gt;&lt;P data-unlink="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;/** @jsx jsx */ // &amp;lt;-- make sure to include the jsx pragma
import { React, AllWidgetProps, jsx } from 'jimu-core'
import { Card, CardBody } from 'jimu-ui'
import { IMConfig } from '../config'

export default class Widget extends React.PureComponent&amp;lt;AllWidgetProps&amp;lt;{}&amp;gt;, any&amp;gt;{
  render(){
    return (
      &amp;lt;div className="widget-demo jimu-widget m-2" &amp;gt;
      &amp;lt;div&amp;gt;
    &amp;lt;Card&amp;gt;
      &amp;lt;img
        alt="Card image cap"
        src="https://source.unsplash.com/300x200?city"
        width="100%"
      /&amp;gt;
      &amp;lt;CardBody&amp;gt;
        &amp;lt;h5&amp;gt;Custom Footer&amp;lt;/h5&amp;gt;
        &amp;lt;p&amp;gt;Example text for the card content.&amp;lt;/p&amp;gt;
      &amp;lt;/CardBody&amp;gt;
    &amp;lt;/Card&amp;gt;
    &amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;
    )
  }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P data-unlink="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;P data-unlink="true"&gt;I'm new to React/Jimu-UI and it seems like I'm doing it wrong. I'm getting this error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;'CardBody' cannot be used as a JSX component.
  Its instance type 'CardBody' is not a valid JSX element.
    The types returned by 'render()' are incompatible between these types.
      Type 'React.ReactNode' is not assignable to type 'import("c:/ArcGISExperienceBuilder/client/your-extensions/widgets-sample-code/Workflow/node_modules/@types/react/index").ReactNode'.
        Type '{}' is not assignable to type 'ReactNode'.&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P data-unlink="true"&gt;The card won't render properly. I didn't find any proper example on how to do this. Can somebody give me a hint on how to use components in my widget.&lt;/P&gt;&lt;P data-unlink="true"&gt;Thanks for your help!&lt;/P&gt;&lt;P data-unlink="true"&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2023 07:29:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/how-to-use-the-storybook-ui-components-in-your-own/m-p/1302540#M7365</guid>
      <dc:creator>JeroenCaarls</dc:creator>
      <dc:date>2023-06-26T07:29:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to use the Storybook UI Components in your own custom Experience Builder Widget?</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/how-to-use-the-storybook-ui-components-in-your-own/m-p/1302559#M7369</link>
      <description>&lt;P&gt;Did you import CardBody?&lt;/P&gt;&lt;P&gt;import {CardBody} from 'jimu-ui'&lt;/P&gt;&lt;P&gt;&amp;lt;CapitalizedElements&amp;gt;&amp;lt;/CapitalizedElements&amp;gt; in React are React components and need to be defined or imported in the TSX/JSX file they are used in.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2023 17:30:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/how-to-use-the-storybook-ui-components-in-your-own/m-p/1302559#M7369</guid>
      <dc:creator>JeffreyThompson2</dc:creator>
      <dc:date>2023-06-23T17:30:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to use the Storybook UI Components in your own custom Experience Builder Widget?</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/how-to-use-the-storybook-ui-components-in-your-own/m-p/1302854#M7404</link>
      <description>&lt;P&gt;Yes, I did. My fault for not mentioning it updated my code sample in the post. It doesn't complain about Card, only Cardbody.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2023 07:31:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/how-to-use-the-storybook-ui-components-in-your-own/m-p/1302854#M7404</guid>
      <dc:creator>JeroenCaarls</dc:creator>
      <dc:date>2023-06-26T07:31:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to use the Storybook UI Components in your own custom Experience Builder Widget?</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/how-to-use-the-storybook-ui-components-in-your-own/m-p/1305350#M7502</link>
      <description>&lt;P&gt;Seems like these VS Code errors can be ignored, will figure out later how to fix this.&lt;/P&gt;&lt;P&gt;Modified my code a little bit I'm, my tiles/cards are now stored in an array, added Col and CardImg. Layout is fine now.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;        &amp;lt;div&amp;gt;
          &amp;lt;Row&amp;gt;
            {this.tiles.map((tile) =&amp;gt; (
              &amp;lt;Col sm="12" md="6" lg="4"&amp;gt;                
                  &amp;lt;Card className='m-3' onClick={() =&amp;gt; this.handleClick(tile.link,tile.target)}&amp;gt;                  
                    &amp;lt;CardImg
                    
                      src={tile.imageSrc}
                      alt={tile.imageAlt}
                      style={{
                        height: "180px",
                        marginLeft: "auto",
                        marginRight: "auto"
                      }}
                      top
                    /&amp;gt;
                    &amp;lt;CardBody className='widget-card-content'&amp;gt;
                      &amp;lt;h5&amp;gt;{tile.title}&amp;lt;/h5&amp;gt;
                      &amp;lt;p&amp;gt;{tile.description}&amp;lt;/p&amp;gt;
                    &amp;lt;/CardBody&amp;gt;
                  &amp;lt;/Card&amp;gt;
              &amp;lt;/Col&amp;gt;
            ))}
          &amp;lt;/Row&amp;gt;
        &amp;lt;/div&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jul 2023 15:24:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/how-to-use-the-storybook-ui-components-in-your-own/m-p/1305350#M7502</guid>
      <dc:creator>JeroenCaarls</dc:creator>
      <dc:date>2023-07-03T15:24:56Z</dc:date>
    </item>
  </channel>
</rss>

