MCPcopy Index your code
hub / github.com/ionic-team/ionic-framework / renderCard

Method renderCard

core/src/components/card/card.tsx:98–129  ·  view source on GitHub ↗
(mode: Mode)

Source from the content-addressed store, hash-verified

96 }
97
98 private renderCard(mode: Mode) {
99 const clickable = this.isClickable();
100
101 if (!clickable) {
102 return [<slot></slot>];
103 }
104 const { href, routerAnimation, routerDirection, inheritedAriaAttributes } = this;
105 const TagType = clickable ? (href === undefined ? 'button' : 'a') : ('div' as any);
106 const attrs =
107 TagType === 'button'
108 ? { type: this.type }
109 : {
110 download: this.download,
111 href: this.href,
112 rel: this.rel,
113 target: this.target,
114 };
115
116 return (
117 <TagType
118 {...attrs}
119 {...inheritedAriaAttributes}
120 class="card-native"
121 part="native"
122 disabled={this.disabled}
123 onClick={(ev: Event) => openURL(href, ev, routerDirection, routerAnimation)}
124 >
125 <slot></slot>
126 {clickable && mode === 'md' && <ion-ripple-effect></ion-ripple-effect>}
127 </TagType>
128 );
129 }
130
131 render() {
132 const mode = getIonMode(this);

Callers 1

renderMethod · 0.95

Calls 2

isClickableMethod · 0.95
openURLFunction · 0.90

Tested by

no test coverage detected